﻿/*----------------------------------------------------------------			
// Copyright (C) 2012
//
// 文件名：	        IUnitOfWork.cs
// 文件功能描述：  申明UnitOfWork需实现的方法
 * Master HaKu 2012/10/06 create
//----------------------------------------------------------------*/

using System;
using System.Data;
using System.Data.Objects;

namespace Zeus.DAL.EntityFramework.RepoUnit
{
    /// <summary>
    /// UnitOfWork接口说明
    /// </summary>
    public interface IUnitOfWork : IDisposable
    {
        /// <summary>
        /// 
        /// </summary>
        bool IsInTransaction { get; }

        /// <summary>
        /// 
        /// </summary>
        void SaveChanges();

        /// <summary>
        /// 
        /// </summary>
        /// <param name="saveOptions"></param>
        void SaveChanges(SaveOptions saveOptions);

        /// <summary>
        /// 
        /// </summary>
        void BeginTransaction();

        /// <summary>
        /// 
        /// </summary>
        /// <param name="isolationLevel"></param>
        void BeginTransaction(IsolationLevel isolationLevel);

        /// <summary>
        /// 
        /// </summary>
        void RollBackTransaction();

        /// <summary>
        /// 
        /// </summary>
        void CommitTransaction();
    }
}
